package com.itheima.demo.service;

import com.itheima.demo.dao.UserDao;
import com.itheima.demo.dao.UserFeign;
import com.itheima.demo.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class Uservice {
//    @Autowired
//    private UserDao userDao;

    @Autowired
    private UserFeign userFeign;

    public List<User> queryYserByIds(List<Long> ids) {
      List<User> users = new ArrayList<>();
        for (Long id : ids) {
            User user = this.userFeign.queryUserById(id);
            users.add(user);
        }
        return users;
    }
}
